//
//  WPUserInfo.m
//  WeChat
//
//  Created by wpapple on 16/6/14.
//  Copyright © 2016年 红红火火恍恍惚惚嘿嘿嘿. All rights reserved.
//

#import "WPUserInfo.h"

#define UserKey @"userName"
#define LoginStatusKey @"loginStatus"
#define PwdKey @"password"

@implementation WPUserInfo

singleton_implementation(WPUserInfo)

-(void)saveUserInfoToSandbox{
    
    NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
    [defaults setObject:self.user forKey:UserKey];
    [defaults setBool:self.loginStatus forKey:LoginStatusKey];
    [defaults setObject:self.pwd forKey:PwdKey];
    [defaults synchronize];
    
}

-(void)loadUserInfoFromSandbox{
    
    NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
    self.user = [defaults objectForKey:UserKey];
    self.loginStatus = [defaults objectForKey:LoginStatusKey];
    self.pwd = [defaults objectForKey:PwdKey];
    
}

@end
